<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="app">
    </div>
</body>
<script src="./node_modules/vue/dist/vue.js"></script>
<!-- 1、引入 vuex 依赖 -->
<script src="./node_modules/vuex/dist/vuex.js"></script>
<script src="./node_modules/axios/dist/axios.js"></script>
<script>
    let moduleA = {
        state:{
            num:10
        },
        mutations:{},
        actions:{},
        getters:{}
    };
    let moduleB = {
        state:{
            num:100
        },
        mutations:{},
        actions:{},
        getters:{}
    }
    let store = new Vuex.Store({
       modules:{
           a:moduleA,
           b:moduleB
       }
    });
    //拿到模块里的值
    console.log(store);
    console.log(store.state.a.num);
    console.log(store.state.b.num);
    let vm = new Vue({
        store,
        el:"#app",
    })
</script>
</html>